﻿using System.Web.Mvc;
using Amba.Workflow.Services;
using Orchard;
using Orchard.Logging;
using Orchard.UI.Admin;

namespace Amba.Workflow.Controllers
{
    [Admin]
    [ValidateInput(false)]
    public class AdminController : Controller
    {
        private readonly IEventLogService _eventLogService;
        private readonly IOrchardServices _services;
     
        public ILogger Logger { get; set; }

        public AdminController(
            
            IEventLogService eventLogService,
            IOrchardServices services
         
            )
        {
            _services = services;
            _eventLogService = eventLogService;
            
            Logger = NullLogger.Instance;
        }

        public ActionResult List()
        {
            var logRecords = _eventLogService.GetRecords();
            return View(logRecords);    
        }

      
        public ActionResult Delete(int id = 0)
        {
            _eventLogService.Delete(id);
            return RedirectToAction("List");
        }
    }
}